package abg.core.domain.sys;

import abg.core.service.sys.SysDictService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * 文件参数
 */
@Component
public class FileConfig {

    @Resource
    private SysDictService dict;

    //根据类型自动获取前缀
    public String urlPrefix(FileServer fileServer) {
        return dict.getString("sys_file_" + fileServer.name() + "_url_prefix", "");
    }

    public String minioUrlPrefix() {
        return dict.getString("sys_file_minio_url_prefix", "");
    }

    public String minioAccessKey() {
        return dict.getString("sys_file_minio_access_key", "");
    }

    public String minioSecretKey() {
        return dict.getString("sys_file_minio_secret_key", "");
    }

    public String minioBucketName() {
        return dict.getString("sys_file_minio_bucket_name", "");
    }

    public String minioEndpoint() {
        return dict.getString("sys_file_minio_endpoint", "");
    }

    public String minioIntranetEndpoint() {
        return dict.getString("sys_file_minio_intranet_endpoint", "");
    }


}
